
Imports System
Imports System.Web.UI
Imports System.IO
Imports System.Collections
Imports System.Text

Namespace _2bMatesSite
	''' <summary>
	''' Summary description for MainPages.
	''' </summary>
	Public Class MainPages
		Inherits System.Web.UI.Page
		Public pageTemplate As MainLayout1
		Public TemplateID As Integer = -1
		Public cssFileName As String = "2bMates"

		Public Function InitStyle(ByVal styleName As String) As String
			If styleName <> "" Then
				Return "<link rel='stylesheet' href='" + styleName + ".css' type='text/css'>"
			End If
			Return ""
		End Function
		Protected Overloads Overrides Sub AddParsedSubObject(ByVal Control As Object)
			If pageTemplate = Nothing Then
				LoadTemplate()
			End If
			pageTemplate.AddCenterControl(DirectCast(Control, System.Web.UI.Control))
		End Sub

		Protected Sub LoadTemplate()
			Dim template As String = "Controls/MainLayout1.ascx"
			pageTemplate = DirectCast(Page.LoadControl(template), MainLayout1)
			cssFileName = "2bMates"
			'set with DB value
			pageTemplate.StrStyle = InitStyle(cssFileName)
			pageTemplate.PageTitle = Constants.DEFAULT_PAGE_TITLE

			MyBase.Controls.Add(pageTemplate)
		End Sub
	End Class
End Namespace







